# -*- coding: utf-8 -*-
'''
 Source file
 File name: logging.py
 Creation date: 11-09-2011
 Author: dassier

'''

class LogMsg:
    ''' Class to display different kind of message (warning, error, info)
    of the application
    '''
    # Color definition
    WARNING = '\033[33m'
    OK = '\033[92m'
    FAIL = '\033[91m'
    ENDC = '\033[0m'

    def __init__(self, debug=False):
        ''' Set debug to True to allow debug information to be displayed
        '''
        self._debug = debug


    def info(self, message):
        ''' Display information messages
        '''
        msg = u'>>> %s ' % message
        print msg

    def warning(self, message):
        ''' Display warning message
        '''
        msg = LogMsg.WARNING + u'>>> WARNING: ' + LogMsg.ENDC + '%s' % message
        print msg

    def error(self, message):
        ''' Display error message
        '''
        msg = "\n" + LogMsg.FAIL + u'>>> ERROR: ' + LogMsg.ENDC + '%s' % message
        print msg

    def ok(self, message):
        ''' Display OK message
        '''
        msg = LogMsg.OK + u'>>> GOOD : ' + LogMsg.ENDC + '%s' % message
        print msg

    def help(self, message):
        ''' Display help information
        '''
        print message

    def banner(self):
        ''' Display banner information
        '''
        #global VERSION
        VERSION = u'0.1'
        msg = LogMsg.OK + u"SVN Improvement version %s\n" % VERSION + LogMsg.ENDC
        print msg


